from pydantic_settings import BaseSettings

from dotenv import load_dotenv


from . import ROOT_DIR


class EnvModule(BaseSettings):
    JWT_KEY: str
    JWT_EXP: int
    OSS_ACCESS_KEY_ID: str
    OSS_ACCESS_KEY_SECRET: str
    ENDPOINT: str
    BUCKETNAME: str
    REGION: str

    class Config:
        env_file = (ROOT_DIR / ".env").as_posix()
        load_dotenv(env_file)


ENV = EnvModule()
